<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<c:set var="totalResult" value="${param.totalResult}"></c:set><%--合计总数 --%>
<c:set var="currentPage" value="${param.currentPage>0?param.currentPage:0}"></c:set><%--当前页码 --%>
<c:set var="size" value="${param.size}"></c:set><%--每页显示数量 --%>
<c:set var="totalPage" value="${param.totalPage}"></c:set><%--总页数 --%>
<c:set var="entityOrField" value="true"></c:set>
<input type="hidden" name="page" value="${param.currentPage}" id="pagination_number"/>
<c:set var="page_sort" value="${fn:replace(page.sort,':',',')}"></c:set>
<input type="hidden" name="sort" id="page_sort" value="${fn:replace(page_sort,' ','')}"/>
<style type="text/css">.pagination{float:right}</style>
<nav>
<c:choose>
	<c:when test="${totalResult>0}">
		<ul class="pagination">
			<li><a style="padding:4.5px 10px">每页<select name="size" onchange="changeSize(this)" style="color: red;">
			<option value="10" ${size eq 10 ?'selected':'' }>10</option>
			<option value="20" ${size eq 20 ?'selected':'' }>20</option>
			<option value="30" ${size eq 30 ?'selected':'' }>30</option>
			<option value="50" ${size eq 50 ?'selected':'' }>50</option>
			<option value="100" ${size eq 100 ?'selected':'' }>100</option>
			</select></a></li>
			<li><a>第<font color=red><input  type="number" max="${totalPage}" value="${currentPage+1}" style="width: 40px;height: 18px;text-align: center;padding: 0px;margin: 0px" onchange="nextPage(parseInt(this.value)-1)">/${totalPage}</font>页</a></li>
			<li><a>总数<font color=red>${totalResult}</font></a></li>
			<%--添加首页功能--%>
			<li><a onclick="nextPage(${0})">首页</a></li>
			<c:choose>
				<c:when test="${currentPage==0}">
					
					<li><a ><i class='icon-angle-left'></i>上页</a></li>
				</c:when>
				<c:otherwise>
					
					<li style="cursor:pointer;"><a  onclick="nextPage(${currentPage-1})"><i class='icon-angle-left'></i>上页</a></li>
				</c:otherwise>
			</c:choose>
			<c:choose> 
				<c:when test="${totalPage<=(currentPage+1)}">
					<li style="cursor:pointer;"><a  >下页<i class='icon-angle-right'></i></a></li>
				</c:when>
				<c:otherwise>
					<li style="cursor:pointer;"><a onclick="nextPage(${currentPage+1})">下页<i class='icon-angle-right'></i></a></li>
				</c:otherwise>
			</c:choose>
			<%--添加尾页功能--%>
			<li><a onclick="nextPage(${totalPage-1})">尾页</a></li>
			</ul> 
			<script type="text/javascript">
			function nextPage(page){
				top.jzts();
				if(true && document.forms[0]){
					document.all.pagination_number.value = page; 
					document.forms[0].submit();
				}
			}
			</script>
	</c:when>
	<c:when test="${totalResult eq 0}">
		<ul class="pagination">
			<li><a>第<font color=red>${currentPage+1}</font>页</a></li>
			
			<c:choose>
				<c:when test="${currentPage==0}">
					<li><a class='btn btn-mini btn-action'><i class='icon-angle-left'></i>上页</a></li>
				</c:when>
				<c:otherwise>
					<li style="cursor:pointer;"><a class='btn btn-mini btn-info' onclick="nextPage(${currentPage-1})"><i class='icon-angle-left'></i>上页</a></li>
				</c:otherwise>
			</c:choose>
			<c:choose> 
				<c:when test="${fn:length(page.content)<size}">
					<li style="cursor:pointer;"><a  class='btn btn-mini btn-action'>下页<i class='icon-angle-right'></i></a></li>
				</c:when>
				<c:otherwise>
					<li style="cursor:pointer;"><a  class='btn btn-mini btn-info' onclick="nextPage(${currentPage+1})">下页<i class='icon-angle-right'></i></a></li>
				</c:otherwise>
			</c:choose>
			</ul> 
			<script type="text/javascript">
			function nextPage(page){
				top.jzts();
				if(true && document.forms[0]){
					document.all.pagination_number.value = page; 
					document.forms[0].submit();
				}
			}
			</script>
	</c:when>
	<c:otherwise>
	</c:otherwise>
	
	
</c:choose>
<script type="text/javascript">
			function changeSize(o){
				top.jzts();
				if(true && document.forms[0]){
					document.forms[0].submit();
				}
			}
			</script>
</div>
</nav>